package com.zemo.base.common.exception;


import com.zemo.base.common.enums.ErrorCodeEnum;

/**
 * RPC 调用异常
 */
public class RpcException extends RuntimeException {

    private String code;
    public RpcException(Throwable e) {
        super(e);
    }

    public RpcException(String code, String msg) {
        super( msg);
        this.code = code;
    }

    public RpcException(ErrorCodeEnum codeDef) {
        super(codeDef.getMsg());
        this.code = codeDef.getCode();
    }

    public RpcException(ErrorCodeEnum codeDef, Throwable e) {
        super(codeDef.getMsg(), e);
        this.code = codeDef.getCode();
    }

    public String getCode() {
        return code;
    }

}
